***Recode variables***

recode hincfel 1=4 2=3 3=2 4=1

label define hincfel 1 "Very difficult" 2 "Difficult" 3 "Coping" 4 "Living comfortably", replace

label define hinctnta 1 "1st" 2 "2nd" 3 "3rd" 4 "4th" 5 "5th" 6 "6th" 7 "7th" 8 "8th" 9 "9th" 10 "10th", replace
 

***choose variables and make descriptive stats***

sum auth_country comm_country wdi_ue mad_pop wdi_infl wdi_gdpc solt_gininc solt_ginred age_demo DQ 

sum hinctnta eduyrs unempdummy hincfel plinsoc

sum polintdummy lrscale agea     

sum stfdem exp_liberal ev_liberal exp_social ev_social exp_direct ev_direct gap_liberal gap_social gap_direct


***Panel var xtset

xtset clear

encode cntry, gen(contry)
drop cntry
rename contry cntry

xtset cntry


****Expectations***

****All models together, plot them 


quietly eststo Liberal: xtmixed exp_liberal hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Direct: xtmixed exp_direct hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Social: xtmixed exp_social hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

*esttab Liberal Social Direct using EvAll.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace

coefplot Liberal Social Direct, drop (_cons unempdummy) xline(0) byopts(xrescale) norecycle legend(rows(1))

drop _est_Liberal _est_Direct _est_Social


***Efects on evaluations***

****All models together, plot them 


quietly eststo Liberal: xtmixed ev_liberal hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Direct: xtmixed ev_direct hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Social: xtmixed ev_social hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

*esttab Liberal Social Direct using EvAll.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace

coefplot Liberal Social Direct, drop (_cons unempdummy) xline(0) byopts(xrescale) norecycle legend(rows(1))

drop _est_Liberal _est_Direct _est_Social


***Efects on gap***

****All models together, plot them 


quietly eststo Liberal: xtmixed gap_liberal hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Direct: xtmixed gap_direct hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

quietly eststo Social: xtmixed gap_social hinctnta eduyrs unempdummy plinsoc hincfel maledummy agea wdi_gdpc mad_pop wdi_infl age_demo solt_gininc solt_ginred DQ || country:

*esttab Liberal Social Direc tusing GapAll.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace

coefplot Liberal Direct Social, drop (_cons unempdummy) xline(0) byopts(xrescale) norecycle legend(rows(1))

drop _est_Liberal _est_Direct _est_Social



